﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace Shared.JwtHelper
{
    /// <summary>
    /// Token配置
    /// </summary>
    public class TokenManagement
    {
        /// <summary>
        /// 密钥
        /// </summary>
        [JsonProperty("Secret")]
        public string Secret { get; set; }

        /// <summary>
        /// 证书颁发系统
        /// </summary>
        [JsonProperty("Issuer")]
        public string Issuer { get; set; }

        /// <summary>
        /// 观众 / 使用方
        /// </summary>
        [JsonProperty("Audience")]
        public string Audience { get; set; }

        /// <summary>
        /// 过期时间(分钟)
        /// </summary>
        [JsonProperty("AccessExpiration")]
        public int AccessExpiration { get; set; }
        #region 带有刷新Token 的功能
        ///// <summary>
        ///// 刷新Token颁发系统
        ///// 与 Audience 不一致,是为了防止通过 RefreshToken 访问Api
        ///// 而AccessToken不能用于刷新Token
        ///// </summary>
        //[JsonProperty("RefreshTokenAudience")]
        //public string RefreshTokenAudience { get; set; }
        #endregion

        /// <summary>
        /// 刷新过期时间
        /// </summary>
        [JsonProperty("RefreshTokenExpiresMinutes")]
        public int RefreshTokenExpiresMinutes { get; set; }
    }
}
